Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry brew update to fix errors about another active Homebrew process being active #1032

Merged
merged 3 commits into from
Oct 12, 2023

Conversation

azeey
Copy link
Contributor

@azeey azeey commented Oct 11, 2023

We're getting the "Another active Homebrew update process is already in progress" error very frequently now, so this is an attempt to fix it. It doesn't seem like a great approach since homebrew should be cleaning things up itself, but might be worth a try. At least, this is something others have recommended. From the logs, brew is able to install things before _homebrew_cleanup.bash is called, so I figured removing the locks when that script is done might fix the issue. The fix retries running brew update several times until it succeeds.

@azeey azeey requested a review from j-rivero as a code owner October 11, 2023 17:52
@azeey azeey requested a review from scpeters October 11, 2023 17:52
@scpeters
Copy link
Contributor

scpeters commented Oct 12, 2023

there was a related issue Homebrew/brew#13521 that was fixed in Homebrew/brew#13586. Also, there was an earlier bug report Homebrew/brew#1155 that mentioned that git may be auto-packing the repository in the background, which I believe was the motivation for the git fsck calls added in f5e9ef9.

Also, Mike McQuaid was clearly 👎 on blindly removing locks in Homebrew/brew#1155 (comment).

If we want a workaround, perhaps we can sleep and retry brew update a few times to see how long it takes to release the other process?

Signed-off-by: Addisu Z. Taddese <[email protected]>
@azeey
Copy link
Contributor Author

azeey commented Oct 12, 2023

Okay, using retries instead in 5696800

@azeey
Copy link
Contributor Author

azeey commented Oct 12, 2023

Test builds:
gz-transport: Build Status
Same gz-transport params: Build Status
sdformat: Build Status

@azeey azeey changed the title Remove homebrew locks to avoid errors about another active Homebrew process being active Retry brew update to fix errors about another active Homebrew process being active Oct 12, 2023
@scpeters
Copy link
Contributor

scpeters commented Oct 12, 2023

Signed-off-by: Addisu Z. Taddese <[email protected]>
@azeey
Copy link
Contributor Author

azeey commented Oct 12, 2023

I looked at the following recent failure, and I think it failed at the following brew update invocation:

Ah, you're right. If the problem is potentially due to the git fsck, it makes sense to put the retries there. Done in 33c0951 and fixed a redundancy in calling brew update.

@scpeters
Copy link
Contributor

@scpeters
Copy link
Contributor

let's try it!

@azeey azeey merged commit 312fa95 into master Oct 12, 2023
1 check passed
@azeey azeey deleted the azeey/homebrew_rm_locks branch October 12, 2023 22:15
j-rivero pushed a commit that referenced this pull request Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants